/******************************************************************************
*
*               Copyright Mentor Graphics Corporation 2003
*                           All rights reserved
*
*   THIS WORK CONTAINS TRADE SECRETS AND PROPRIETARY INFORMATION WHICH IS
*    THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS
*                        SUBJECT TO LICENSE TERMS
*
*******************************************************************************

*******************************************************************************
* FILE NAME                                                          VERSION
* act_fund_types_test.c                                                1.1
*
* COMPONENT
* ANSI/ISO C test application
*
* DESCRIPTION
* Demonstrates the use of different fundamental types
*
* DATA STRUCTURES
*
*
* FUNCTIONS
* int FundamentalTypeLocationTest( int formal0, int formal1, int formal2)
* int act_fundamental_types_test(int value)
*
* DEPENDENCIES
* act_test.h
******************************************************************************/

#include "act_test.h"

#if (ACT_FUNDAMENTAL_TYPES_TEST)

/******************************************************************************
* FUNCTION
* int FundamentalTypeLocationTest( int formal0, int formal1, int formal2)
*
* DESCRIPTION
* Demonstrates the use of different fundamental type declarations
* register, signed and unsigned char, int, short and long
*
* INPUTS
* int formal10
* int formal11
* int formal12
*
* OUTPUTS
* int
******************************************************************************/
int FundamentalTypeLocationTest( int formal0, int formal1, int formal2)
{
     register int regint0;
     register int regint1;
     int stackLocal;
     regint0 = 1;
     regint1 = 27;

     stackLocal = formal0 + formal1 + formal2;

     if (regint0)
     {
          int insidescope;
          insidescope = regint1 + regint0;
          stackLocal += stackLocal +  insidescope;
     }

     return stackLocal;
}

char               g_char		= 'a';
unsigned char      g_u_char	    = 'b';

int                g_int		= 1234;
unsigned           g_unsigned	= 12345;

short              g_short		= 4567;
unsigned short     g_u_short	= 12456;

long               g_long		= 12121212;
unsigned long      g_u_long	    = 0xFFFFFFFF;



/******************************************************************************
* FUNCTION
* int act_fundamental_types_test(int value)
*
* DESCRIPTION
* Demonstrates the use of different fundamental type declarations
* register, signed and unsigned char, int, short and long
*
* INPUTS
* int value
*
* OUTPUTS
* int
******************************************************************************/
int act_fundamental_types_test(int value)
{

     char           l_char		= g_char;
     unsigned char  l_u_char	= g_u_char;

     int            l_int		= g_int;
     unsigned       l_unsigned	= g_unsigned;

     short          l_short		= g_short;
     unsigned short l_u_short	= g_u_short;

     long            l_long		= g_long;
     unsigned long   l_u_long	= g_u_long;

     l_int += FundamentalTypeLocationTest( l_int, g_int, 627 );
     return( l_char + l_u_char + l_int + l_unsigned + l_short + l_u_short + l_long + l_u_long );
}

#endif
